package com.docking.heylo.web.dto;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

public class EnrollmentDto {

    @NotEmpty(message = "{phone.null}", groups = {SendVerCode.class, SubmitEnrollment.class, Login.class})
    @Pattern(regexp = "^1\\d{10}",message = "{phone.error}", groups = {SendVerCode.class, SubmitEnrollment.class, Login.class})
    public String phone;

    @NotEmpty(message = "{vercode.null}", groups = {SubmitEnrollment.class})
    @Length(min = 6,max = 6, message = "{vercode.error}",groups = {SubmitEnrollment.class})
    public String verCode;

    @NotEmpty(message = "{password.null}", groups = {Login.class, SetPassword.class})
    @Length(min = 6,max = 32, message = "{password.error}",groups = {Login.class, SetPassword.class})
    public String password;

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getVerCode() {
        return verCode;
    }

    public void setVerCode(String verCode) {
        this.verCode = verCode;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public interface SendVerCode {}

    public interface SubmitEnrollment {}

    public interface Login {}

    public interface SetPassword {}

}
